package com.qf.day06;

public class Animal {
    private String name;
    private String type;
    private int age;
    private String sex;

    public Animal() {
    }



    public Animal(String name, String type, int age, String sex) {
        this.name=name;//姓名
        this.type = type;//品种
        this.age = age;//年龄
        this.sex = sex;//性别
    }
    public void eat(){
        System.out.println(getName()+"在吃饭");
    }
    public void sleep(){
        System.out.println(getName()+"在睡觉");
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

//    @Override
//    public String toString() {
//        return "Animal{" +
//                "name='" + name + '\'' +
//                ", type='" + type + '\'' +
//                ", age=" + age +
//                ", sex='" + sex + '\'' +
//                '}';
//    }
}
